package coupon

import (
	"enjoy-shop/formdata"
	clientCoupon "gitee.com/enjoy_5/coupons-rpc/client"
	pb "gitee.com/enjoy_5/coupons-rpc/proto/coupon"
)

func GoodsOrderCouponList(userCoupon formdata.GoodsOrderCouponList) (*pb.CouponListResp, error) {
	couponListReq := &pb.CouponListReq{
		UserId: userCoupon.UserId,
		Judge:  userCoupon.Judge,
	}

	return clientCoupon.CouponListByUserID(couponListReq)
}

func UserCenterCouponList(couponListUser formdata.UserCenterCouponList) (*pb.CouponListUserResp, error) {
	p := &pb.CouponListUserReq{
		UserId:       couponListUser.UserId,
		CouponStatus: couponListUser.CouponStatus,
	}

	return clientCoupon.CouponListUserByUserID(p)
}

func MemberList() (*pb.MemberListResp, error) {
	memberList := &pb.MemberListReq{}
	return clientCoupon.MemberList(memberList)
}

func PointsList() (*pb.PointsListResp, error) {
	p := &pb.PointsListReq{}
	return clientCoupon.PointsList(p)
}

func PointsInfo(pointInfo formdata.PointsInfo) (*pb.PointsInfoResp, error) {
	p := &pb.PointsInfoReq{PointsId: pointInfo.PointsID}
	return clientCoupon.PointsInfo(p)
}
